#!/bin/bash

# ***************************************************************************
# * 
# * @file:build.sh 
# * @author:ebayboy@163.com 
# * @date:2019-11-26 22:59 
# * @version 1.0  
# * @description: Shell script 
# * @Copyright (c)  all right reserved 
#* 
#**************************************************************************/ 

#上一级目录名称
PREFIX=/usr/local/

rm build -rf && mkdir build && cd build

cmd="cmake ../ \
	-DENABLE_PIC=on \
	-DCMAKE_INSTALL_PREFIX=$PREFIX/libjwt	\
	-DJANSSON_LIBRARY=$PREFIX/jansson/lib/libjansson.a \
	-DJANSSON_INCLUDE_DIR=$PREFIX/jansson/include || exit 1"

eval ${cmd}

make install

exit 0
